﻿namespace singleton
{
    /// <summary>
    /// 静态变量
    /// </summary>
    public class StaticVariableSingleton
    {
        //静态变量在第一次使用该类时初始化，且只初始化一次
        private static StaticVariableSingleton _instance = new();

        private StaticVariableSingleton()
        {
        }

        public static StaticVariableSingleton Instance()
        {
            return _instance;
        }
    }
}
